﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

using System;
using System.Collections;
using System.Collections.Generic;
using NHibernate;
using Spring.Data.NHibernate.Support;

using VisualAgile.IDAL;
using VisualAgile.Model;
using Spring.Data.NHibernate;
using NHibernate.Engine;

namespace VisualAgile.DAL
{
    public class TaskDao : BaseDao<Task>, ITaskDao
    {
        protected override HibernateTemplate getBaseDAO()
        {
            return HibernateTemplate;
        }

        public IList FindByStory(string StoryId)
        {
            return HibernateTemplate.Find("from Task where StoryID = ?", StoryId);            
        }

        public IList FindByStories(string Stories)
        {
            return HibernateTemplate.Find("from Task where StoryID in ?", Stories);            
        }

        public IList FindByStatus(string StatusId)
        {
            return HibernateTemplate.Find("from Task where StatusID = ?", StatusId);            
        }

        public IList FindByIteration(string IterationId)
        {
            return HibernateTemplate.Find("from Task where IterationID = ?", IterationId);
        }

        public IList FindNonCatagorizedTasks()
        {
            return HibernateTemplate.Find("from Task where StoryID IS NULL");
        }
    }
}